package com.ozo.cloud.system.feign;

import cn.hutool.core.bean.BeanUtil;
import com.ozo.cloud.api.system.dto.SysOperationLogDTO;
import com.ozo.cloud.api.system.feign.SysOperateLogFeignClient;
import com.ozo.cloud.common.base.model.ResultVO;
import com.ozo.cloud.system.entity.SysOperationLog;
import com.ozo.cloud.system.service.ISysOperationLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

/**
 * 操作日志服务调用
 *
 * @author qiangesoft
 * @date 2024-09-11
 */
@RequiredArgsConstructor
@RestController
public class OperateLogFeignFeignController implements SysOperateLogFeignClient {

    public final ISysOperationLogService sysOperationLogService;

    @Override
    public ResultVO<Void> add(SysOperationLogDTO operationLogDTO) {
        SysOperationLog sysOperationLog = BeanUtil.copyProperties(operationLogDTO, SysOperationLog.class);
        sysOperationLogService.save(sysOperationLog);
        return ResultVO.success();
    }

}
